package cn.okcode.slowjson.parser;

/**
 * @author pyk13
 */
public class Token {
    private final TokenKind token;
    private String stringValue;
    private Boolean booleanValue;
    private Double numberValue;

    public Token(TokenKind token) {
        this.token = token;
    }

    public Token(TokenKind token, String stringValue) {
        this.token = token;
        this.stringValue = stringValue;
    }

    public Token(TokenKind token, boolean booleanValue) {
        this.token = token;
        this.booleanValue = booleanValue;
    }

    public Token(TokenKind token, Double numberValue) {
        this.token = token;
        this.numberValue = numberValue;
    }

    public TokenKind getToken() {
        return token;
    }

    public String getStringValue() {
        return stringValue;
    }

    public boolean getBooleanValue() {
        return booleanValue;
    }

    public Double getNumberValue() {
        return numberValue;
    }

    @Override
    public String toString() {
        return token.toString();
    }
}
